<?php
function demo(){
	return true;
}

function test(){
	demo();
	return 123;
}

function foo(){
	$sum = 0;
	for($i=0;$i<1000;$i++)
	{
		$sum += $i;
	}
	test(111);
	return $sum;
}


$xhprof_ignored_functions = array('ignored_functions' =>
	                                  'foo');

//xhprof_enable(XHPROF_FLAGS_MEMORY, $xhprof_ignored_functions);
xhprof_enable();



echo foo();



$xhprof_data = xhprof_disable();

var_dump($xhprof_data);


$xhprof_root = "/home/oae/web/wwwroot/public/xhprof";

include_once $xhprof_root."/xhprof_lib/utils/xhprof_lib.php";
include_once $xhprof_root."/xhprof_lib/utils/xhprof_runs.php";

$xhprof_runs = new XHprofRuns_Default();
$run_id = $xhprof_runs->save_run($xhprof_data, "test");



